<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <body>

        <ui:composition template="./../../Template/generalTemplate.xhtml">


            <ui:define name="content">
                <h:form> 
                    <f:view beforePhase="#{commenceDunningProcessManagedBean.initView}">    
                        <p:panel header="Commence Dunning Email" style="height:495px;">
                            <div style="margin-left: 280px;margin-top: 100px;">
                                <p style="color:slategray; font:12px;">Create a Dunning Email </p>
                                <h:outputText value="Input Invoice Id" style="margin-right:10px;"/>
                                <h:inputText value="#{commenceDunningProcessManagedBean.invoiceId}"/>
                                <h:selectOneMenu style="margin-left:15px;" value="#{commenceDunningProcessManagedBean.dunningEmail.patternId}">
                                    <f:selectItem itemLabel="Choose The pattern" noSelectionOption="true"/>
                                    <f:selectItem itemValue= "1" itemLabel="First Reminder - Not Paid"/>
                                    <f:selectItem itemValue= "2" itemLabel="Second Reminder - Not Paid"/>
                                    <f:selectItem itemValue= "11" itemLabel="First Reminder - Uncomplete Payment"/>
                                    <f:selectItem itemValue= "12" itemLabel="Second Reminder - Uncomplete Payment"/>
                                    <f:selectItem itemValue= "3" itemLabel="Last Call"/>

                                </h:selectOneMenu>
                                <br/>
                                <p:commandButton value="Create" update ="message" action="#{commenceDunningProcessManagedBean.createDunningEmail}" style="margin-top:10px;"/>
                                <p:ajaxStatus style="width:16px;height:16px;">  
                                    <f:facet name="start">  
                                        <h:graphicImage value="/images/loading.gif" />
                                    </f:facet>  
                                    <f:facet name="error">
                                        <h:outputText value="Error" />
                                    </f:facet>
                                    <f:facet name="complete">  
                                        <h:outputText value="" />  
                                    </f:facet>  
                                </p:ajaxStatus>  
                                <p:messages id ="message"/>
                            </div>
                        </p:panel> 
                    </f:view>
                </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
